﻿using UnityEngine;
using UnityEngine.Events; 

namespace XFGameFramework
{ 
    public class TimerObject : MonoBehaviour
    {
        // Fix编码
        [Tooltip("延迟时间")]
        public float delay;
        [Tooltip("事件回调")]
        public UnityEvent Action;
         

        private void OnEnable()
        {
            TimerManager.DelayInvoke(gameObject,OnAction, delay);
        }

        

        private void OnAction()
        {
            Action?.Invoke();
        } 
    } 
}